package com.yf.dao;

import com.yf.entity.UserEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户Dao
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Thu Aug 16 13:36:44 CST 2018
 */
public interface UserDao extends BaseDao<UserEntity> {


    /**
     * 通过Tree查询下级
     * @param uid
     * @return
     */
    List<UserEntity>  findDownByTree(String path);

    /**
     * 通过Tree查询上级
     * @param uid
     * @return
     */
    List<UserEntity>  findUpByTree(@Param("parentIds") String[] parentIds);

    /**
     * 直接下级
     * @param userId
     * @return
     */
    List<UserEntity> findDown(Long userId);

    List<UserEntity> findByUnionId(String unionId);

    List<UserEntity> findByOpenId(String openId);

    List<UserEntity> findByPhone(String phone);

    void updateDownPath(@Param("oldPath") String oldPath, @Param("newPath") String newPath);

}
